//
//  SettingViewController.m
//  Emoticon
//
//  Created by ytkjs2 on 2020/3/26.
//  Copyright © 2020 ytk. All rights reserved.
//

#import "SettingViewController.h"
#import "SettingTableViewCell.h"
#import "CollectionViewController.h"

@interface SettingViewController ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"设置";
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 55;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    SettingTableViewCell * cell = [[NSBundle mainBundle]loadNibNamed:@"SettingTableViewCell" owner:nil options:nil][0];
    NSArray * arr = [NSArray arrayWithObjects:@"壁纸·斗图收藏",@"清理缓存",@"关于我们",@"问题反馈", nil];
    cell.lab.text = arr[indexPath.row];
    [cell.img setImage:[UIImage imageNamed:[NSString stringWithFormat:@"icon_setting%ld",indexPath.row]]];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    switch (indexPath.row) {
        case 0:
            {
                CollectionViewController * collectVC = [[CollectionViewController alloc]initWithNibName:@"CollectionViewController" bundle:[NSBundle mainBundle]];
                collectVC.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:collectVC animated:YES];
            }
            break;
        case 1:
            
            break;
        case 2:
            
            break;
        case 3:
            
            break;
        default:
            break;
    }
}




/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
